3.8.72 \(\int \cos ^4(c+d x) (a+b \sec (c+d x)) (B \sec (c+d x)+C \sec ^2(c+d x)) \, dx\) [772]

3.8.72.1 Optimal result
3.8.72.2 Mathematica [A] (verified)
3.8.72.3 Rubi [A] (verified)
3.8.72.4 Maple [A] (verified)
3.8.72.5 Fricas [A] (verification not implemented)
3.8.72.6 Sympy [F]
3.8.72.7 Maxima [A] (verification not implemented)
3.8.72.8 Giac [B] (verification not implemented)
3.8.72.9 Mupad [B] (verification not implemented)

3.8.72.1 Optimal result

Integrand size = 38, antiderivative size = 84 \[ \int \cos ^4(c+d x) (a+b \sec (c+d x)) \left (B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\frac {1}{2} (b B+a C) x+\frac {(2 a B+3 b C) \sin (c+d x)}{3 d}+\frac {(b B+a C) \cos (c+d x) \sin (c+d x)}{2 d}+\frac {a B \cos ^2(c+d x) \sin (c+d x)}{3 d} \]

output
1/2*(B*b+C*a)*x+1/3*(2*B*a+3*C*b)*sin(d*x+c)/d+1/2*(B*b+C*a)*cos(d*x+c)*si 
n(d*x+c)/d+1/3*a*B*cos(d*x+c)^2*sin(d*x+c)/d
 
3.8.72.2 Mathematica [A] (verified)

Time = 0.10 (sec) , antiderivative size = 75, normalized size of antiderivative = 0.89 \[ \int \cos ^4(c+d x) (a+b \sec (c+d x)) \left (B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\frac {6 b B c+6 a c C+6 b B d x+6 a C d x+3 (3 a B+4 b C) \sin (c+d x)+3 (b B+a C) \sin (2 (c+d x))+a B \sin (3 (c+d x))}{12 d} \]

input
Integrate[Cos[c + d*x]^4*(a + b*Sec[c + d*x])*(B*Sec[c + d*x] + C*Sec[c + 
d*x]^2),x]
 
output
(6*b*B*c + 6*a*c*C + 6*b*B*d*x + 6*a*C*d*x + 3*(3*a*B + 4*b*C)*Sin[c + d*x 
] + 3*(b*B + a*C)*Sin[2*(c + d*x)] + a*B*Sin[3*(c + d*x)])/(12*d)
 
3.8.72.3 Rubi [A] (verified)

Time = 0.56 (sec) , antiderivative size = 82, normalized size of antiderivative = 0.98, number of steps used = 11, number of rules used = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.289, Rules used = {3042, 4560, 3042, 4484, 25, 3042, 4274, 3042, 3115, 24, 3117}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \cos ^4(c+d x) (a+b \sec (c+d x)) \left (B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {\left (a+b \csc \left (c+d x+\frac {\pi }{2}\right )\right ) \left (B \csc \left (c+d x+\frac {\pi }{2}\right )+C \csc \left (c+d x+\frac {\pi }{2}\right )^2\right )}{\csc \left (c+d x+\frac {\pi }{2}\right )^4}dx\)

\(\Big \downarrow \) 4560

\(\displaystyle \int \cos ^3(c+d x) (a+b \sec (c+d x)) (B+C \sec (c+d x))dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {\left (a+b \csc \left (c+d x+\frac {\pi }{2}\right )\right ) \left (B+C \csc \left (c+d x+\frac {\pi }{2}\right )\right )}{\csc \left (c+d x+\frac {\pi }{2}\right )^3}dx\)

\(\Big \downarrow \) 4484

\(\displaystyle \frac {a B \sin (c+d x) \cos ^2(c+d x)}{3 d}-\frac {1}{3} \int -\cos ^2(c+d x) (3 (b B+a C)+(2 a B+3 b C) \sec (c+d x))dx\)

\(\Big \downarrow \) 25

\(\displaystyle \frac {1}{3} \int \cos ^2(c+d x) (3 (b B+a C)+(2 a B+3 b C) \sec (c+d x))dx+\frac {a B \sin (c+d x) \cos ^2(c+d x)}{3 d}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {1}{3} \int \frac {3 (b B+a C)+(2 a B+3 b C) \csc \left (c+d x+\frac {\pi }{2}\right )}{\csc \left (c+d x+\frac {\pi }{2}\right )^2}dx+\frac {a B \sin (c+d x) \cos ^2(c+d x)}{3 d}\)

\(\Big \downarrow \) 4274

\(\displaystyle \frac {1}{3} \left (3 (a C+b B) \int \cos ^2(c+d x)dx+(2 a B+3 b C) \int \cos (c+d x)dx\right )+\frac {a B \sin (c+d x) \cos ^2(c+d x)}{3 d}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {1}{3} \left ((2 a B+3 b C) \int \sin \left (c+d x+\frac {\pi }{2}\right )dx+3 (a C+b B) \int \sin \left (c+d x+\frac {\pi }{2}\right )^2dx\right )+\frac {a B \sin (c+d x) \cos ^2(c+d x)}{3 d}\)

\(\Big \downarrow \) 3115

\(\displaystyle \frac {1}{3} \left ((2 a B+3 b C) \int \sin \left (c+d x+\frac {\pi }{2}\right )dx+3 (a C+b B) \left (\frac {\int 1dx}{2}+\frac {\sin (c+d x) \cos (c+d x)}{2 d}\right )\right )+\frac {a B \sin (c+d x) \cos ^2(c+d x)}{3 d}\)

\(\Big \downarrow \) 24

\(\displaystyle \frac {1}{3} \left ((2 a B+3 b C) \int \sin \left (c+d x+\frac {\pi }{2}\right )dx+3 (a C+b B) \left (\frac {\sin (c+d x) \cos (c+d x)}{2 d}+\frac {x}{2}\right )\right )+\frac {a B \sin (c+d x) \cos ^2(c+d x)}{3 d}\)

\(\Big \downarrow \) 3117

\(\displaystyle \frac {1}{3} \left (\frac {(2 a B+3 b C) \sin (c+d x)}{d}+3 (a C+b B) \left (\frac {\sin (c+d x) \cos (c+d x)}{2 d}+\frac {x}{2}\right )\right )+\frac {a B \sin (c+d x) \cos ^2(c+d x)}{3 d}\)

input
Int[Cos[c + d*x]^4*(a + b*Sec[c + d*x])*(B*Sec[c + d*x] + C*Sec[c + d*x]^2 
),x]
 
output
(a*B*Cos[c + d*x]^2*Sin[c + d*x])/(3*d) + (((2*a*B + 3*b*C)*Sin[c + d*x])/ 
d + 3*(b*B + a*C)*(x/2 + (Cos[c + d*x]*Sin[c + d*x])/(2*d)))/3
 

3.8.72.3.1 Defintions of rubi rules used

rule 24
Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]
 

rule 25
Int[-(Fx_), x_Symbol] :> Simp[Identity[-1]   Int[Fx, x], x]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 3115
Int[((b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[(-b)*Cos[c + d* 
x]*((b*Sin[c + d*x])^(n - 1)/(d*n)), x] + Simp[b^2*((n - 1)/n)   Int[(b*Sin 
[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1] && IntegerQ[ 
2*n]
 

rule 3117
Int[sin[Pi/2 + (c_.) + (d_.)*(x_)], x_Symbol] :> Simp[Sin[c + d*x]/d, x] /; 
 FreeQ[{c, d}, x]
 

rule 4274
Int[(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_.)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + 
(a_)), x_Symbol] :> Simp[a   Int[(d*Csc[e + f*x])^n, x], x] + Simp[b/d   In 
t[(d*Csc[e + f*x])^(n + 1), x], x] /; FreeQ[{a, b, d, e, f, n}, x]
 

rule 4484
Int[(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + ( 
a_))*(csc[(e_.) + (f_.)*(x_)]*(B_.) + (A_)), x_Symbol] :> Simp[A*a*Cot[e + 
f*x]*((d*Csc[e + f*x])^n/(f*n)), x] + Simp[1/(d*n)   Int[(d*Csc[e + f*x])^( 
n + 1)*Simp[n*(B*a + A*b) + (B*b*n + A*a*(n + 1))*Csc[e + f*x], x], x], x] 
/; FreeQ[{a, b, d, e, f, A, B}, x] && NeQ[A*b - a*B, 0] && LeQ[n, -1]
 

rule 4560
Int[((a_.) + csc[(e_.) + (f_.)*(x_)]*(b_.))^(m_.)*((A_.) + csc[(e_.) + (f_. 
)*(x_)]*(B_.) + csc[(e_.) + (f_.)*(x_)]^2*(C_.))*((c_.) + csc[(e_.) + (f_.) 
*(x_)]*(d_.))^(n_.), x_Symbol] :> Simp[1/b^2   Int[(a + b*Csc[e + f*x])^(m 
+ 1)*(c + d*Csc[e + f*x])^n*(b*B - a*C + b*C*Csc[e + f*x]), x], x] /; FreeQ 
[{a, b, c, d, e, f, A, B, C, m, n}, x] && EqQ[A*b^2 - a*b*B + a^2*C, 0]
 
3.8.72.4 Maple [A] (verified)

Time = 0.38 (sec) , antiderivative size = 65, normalized size of antiderivative = 0.77

method result size
parallelrisch \(\frac {3 \left (B b +C a \right ) \sin \left (2 d x +2 c \right )+a B \sin \left (3 d x +3 c \right )+3 \left (3 a B +4 C b \right ) \sin \left (d x +c \right )+6 \left (B b +C a \right ) x d}{12 d}\) \(65\)
derivativedivides \(\frac {\frac {a B \left (2+\cos \left (d x +c \right )^{2}\right ) \sin \left (d x +c \right )}{3}+B b \left (\frac {\sin \left (d x +c \right ) \cos \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+C a \left (\frac {\sin \left (d x +c \right ) \cos \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+C \sin \left (d x +c \right ) b}{d}\) \(85\)
default \(\frac {\frac {a B \left (2+\cos \left (d x +c \right )^{2}\right ) \sin \left (d x +c \right )}{3}+B b \left (\frac {\sin \left (d x +c \right ) \cos \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+C a \left (\frac {\sin \left (d x +c \right ) \cos \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+C \sin \left (d x +c \right ) b}{d}\) \(85\)
risch \(\frac {B b x}{2}+\frac {a x C}{2}+\frac {3 a B \sin \left (d x +c \right )}{4 d}+\frac {\sin \left (d x +c \right ) C b}{d}+\frac {a B \sin \left (3 d x +3 c \right )}{12 d}+\frac {\sin \left (2 d x +2 c \right ) B b}{4 d}+\frac {\sin \left (2 d x +2 c \right ) C a}{4 d}\) \(85\)
norman \(\frac {\left (\frac {B b}{2}+\frac {C a}{2}\right ) x +\left (-\frac {B b}{2}-\frac {C a}{2}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}+\left (-\frac {B b}{2}-\frac {C a}{2}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{8}+\left (\frac {B b}{2}+\frac {C a}{2}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{12}+\left (-2 B b -2 C a \right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{6}+\left (B b +C a \right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}+\left (B b +C a \right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{10}+\frac {\left (2 a B -B b -C a +2 C b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{11}}{d}+\frac {\left (2 a B +B b +C a +2 C b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}-\frac {\left (2 a B -3 B b -3 C a -6 C b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{9}}{3 d}-\frac {2 \left (2 a B -3 B b -3 C a +6 C b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{7}}{3 d}-\frac {\left (2 a B +3 B b +3 C a -6 C b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{3 d}-\frac {2 \left (2 a B +3 B b +3 C a +6 C b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{3 d}}{\left (1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )^{4} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-1\right )^{2}}\) \(364\)

input
int(cos(d*x+c)^4*(a+b*sec(d*x+c))*(B*sec(d*x+c)+C*sec(d*x+c)^2),x,method=_ 
RETURNVERBOSE)
 
output
1/12*(3*(B*b+C*a)*sin(2*d*x+2*c)+a*B*sin(3*d*x+3*c)+3*(3*B*a+4*C*b)*sin(d* 
x+c)+6*(B*b+C*a)*x*d)/d
 
3.8.72.5 Fricas [A] (verification not implemented)

Time = 0.26 (sec) , antiderivative size = 60, normalized size of antiderivative = 0.71 \[ \int \cos ^4(c+d x) (a+b \sec (c+d x)) \left (B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\frac {3 \, {\left (C a + B b\right )} d x + {\left (2 \, B a \cos \left (d x + c\right )^{2} + 4 \, B a + 6 \, C b + 3 \, {\left (C a + B b\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{6 \, d} \]

input
integrate(cos(d*x+c)^4*(a+b*sec(d*x+c))*(B*sec(d*x+c)+C*sec(d*x+c)^2),x, a 
lgorithm="fricas")
 
output
1/6*(3*(C*a + B*b)*d*x + (2*B*a*cos(d*x + c)^2 + 4*B*a + 6*C*b + 3*(C*a + 
B*b)*cos(d*x + c))*sin(d*x + c))/d
 
3.8.72.6 Sympy [F]

\[ \int \cos ^4(c+d x) (a+b \sec (c+d x)) \left (B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\int \left (B + C \sec {\left (c + d x \right )}\right ) \left (a + b \sec {\left (c + d x \right )}\right ) \cos ^{4}{\left (c + d x \right )} \sec {\left (c + d x \right )}\, dx \]

input
integrate(cos(d*x+c)**4*(a+b*sec(d*x+c))*(B*sec(d*x+c)+C*sec(d*x+c)**2),x)
 
output
Integral((B + C*sec(c + d*x))*(a + b*sec(c + d*x))*cos(c + d*x)**4*sec(c + 
 d*x), x)
 
3.8.72.7 Maxima [A] (verification not implemented)

Time = 0.22 (sec) , antiderivative size = 79, normalized size of antiderivative = 0.94 \[ \int \cos ^4(c+d x) (a+b \sec (c+d x)) \left (B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=-\frac {4 \, {\left (\sin \left (d x + c\right )^{3} - 3 \, \sin \left (d x + c\right )\right )} B a - 3 \, {\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} C a - 3 \, {\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} B b - 12 \, C b \sin \left (d x + c\right )}{12 \, d} \]

input
integrate(cos(d*x+c)^4*(a+b*sec(d*x+c))*(B*sec(d*x+c)+C*sec(d*x+c)^2),x, a 
lgorithm="maxima")
 
output
-1/12*(4*(sin(d*x + c)^3 - 3*sin(d*x + c))*B*a - 3*(2*d*x + 2*c + sin(2*d* 
x + 2*c))*C*a - 3*(2*d*x + 2*c + sin(2*d*x + 2*c))*B*b - 12*C*b*sin(d*x + 
c))/d
 
3.8.72.8 Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 180 vs. \(2 (76) = 152\).

Time = 0.29 (sec) , antiderivative size = 180, normalized size of antiderivative = 2.14 \[ \int \cos ^4(c+d x) (a+b \sec (c+d x)) \left (B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\frac {3 \, {\left (C a + B b\right )} {\left (d x + c\right )} + \frac {2 \, {\left (6 \, B a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 3 \, C a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 3 \, B b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 6 \, C b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 4 \, B a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 12 \, C b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 6 \, B a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 3 \, C a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 3 \, B b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 6 \, C b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )}^{3}}}{6 \, d} \]

input
integrate(cos(d*x+c)^4*(a+b*sec(d*x+c))*(B*sec(d*x+c)+C*sec(d*x+c)^2),x, a 
lgorithm="giac")
 
output
1/6*(3*(C*a + B*b)*(d*x + c) + 2*(6*B*a*tan(1/2*d*x + 1/2*c)^5 - 3*C*a*tan 
(1/2*d*x + 1/2*c)^5 - 3*B*b*tan(1/2*d*x + 1/2*c)^5 + 6*C*b*tan(1/2*d*x + 1 
/2*c)^5 + 4*B*a*tan(1/2*d*x + 1/2*c)^3 + 12*C*b*tan(1/2*d*x + 1/2*c)^3 + 6 
*B*a*tan(1/2*d*x + 1/2*c) + 3*C*a*tan(1/2*d*x + 1/2*c) + 3*B*b*tan(1/2*d*x 
 + 1/2*c) + 6*C*b*tan(1/2*d*x + 1/2*c))/(tan(1/2*d*x + 1/2*c)^2 + 1)^3)/d
 
3.8.72.9 Mupad [B] (verification not implemented)

Time = 17.10 (sec) , antiderivative size = 84, normalized size of antiderivative = 1.00 \[ \int \cos ^4(c+d x) (a+b \sec (c+d x)) \left (B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\frac {B\,b\,x}{2}+\frac {C\,a\,x}{2}+\frac {3\,B\,a\,\sin \left (c+d\,x\right )}{4\,d}+\frac {C\,b\,\sin \left (c+d\,x\right )}{d}+\frac {B\,a\,\sin \left (3\,c+3\,d\,x\right )}{12\,d}+\frac {B\,b\,\sin \left (2\,c+2\,d\,x\right )}{4\,d}+\frac {C\,a\,\sin \left (2\,c+2\,d\,x\right )}{4\,d} \]

input
int(cos(c + d*x)^4*(B/cos(c + d*x) + C/cos(c + d*x)^2)*(a + b/cos(c + d*x) 
),x)
 
output
(B*b*x)/2 + (C*a*x)/2 + (3*B*a*sin(c + d*x))/(4*d) + (C*b*sin(c + d*x))/d 
+ (B*a*sin(3*c + 3*d*x))/(12*d) + (B*b*sin(2*c + 2*d*x))/(4*d) + (C*a*sin( 
2*c + 2*d*x))/(4*d)